<?php
header('content-type:text/html;charset=utf-8');
require_once($_SITE_PATH_.'m/m_information.php');
$m_information=new m_information();
//$m_information->_ssql='select `id`,`code` FROM information where `flow`>=9 and ts_flag!="1" and `code` is not null and agreement_id is not null and `code`!="" and agreement_id!=""  order by `id` asc limit 0,15';
//`flow`>=9 and ts_flag="1" and `code` is not null and agreement_id is not null and `code`!="" and process_code!="" and process_code is not null and agreement_id!="" and words!="" and agreement.start_time!="" and information.id in ( 49,855,1228,1334,1435,1539 ) and agreement.end_time!=""
$m_information->_ssql='select `id`,`code` FROM information where `flow`>=9 and ts_flag="1" and `code` is not null and agreement_id is not null and `code`!="" and process_code!="" and process_code is not null and agreement_id!="" and words!=""  order by `id` asc ';
$result=$m_information->getArray($m_information->query());
$count=count($result);
$count=$m_information->getCount();

if($count<=0)
	{
		exit;
	}

$id='';
$size=100;
$j=0;
for($i=0;$i<$count;$i++)
	{
		if($i<($size*($j+1)))
			{
				if($result[$i]->code)
					{
						$id[$j].=$result[$i]->code.',';
					}
				
			}
			else
				{	
					$j++;
				}
			
		
	}
$count=count($id);
/* 
echo $j;
echo '<br/>';
echo $count;
echo '<br/>'; 
*/
for($i=0;$i<$count;$i++)
	{
		$id[$i]=rtrim($id[$i],',');
		
		/*
		echo $id[$i];
		echo '<br/>'; 
		*/
		
	}
echo json_encode($id);	
exit;
?>